home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
wardial.arc
/
RCV_ASC.PAS
next >
Wrap
Pascal/Delphi Source File
|
1986-04-30
|
3KB
|
113 lines
Procedure rcv_asc;
var a,b:char;
tempbuff:array[1..256] of char;
infile:text;
file_name:string[20];
ok,go_back:boolean;
pointer,i:integer;
begin
pointer:=1;
go_back:=false;
xcoord:=wherex;
ycoord:=wherey;
Move(screen1,screen2,4000);
Normvideo;
lowvideo;
Window(1,1,80,21);
normvideo;
textcolor(cyan);
frame(14, 5,36,11);
lowvideo;
window(15,6,35,10);
repeat
clrscr;
gotoxy(1,1);
textcolor(white);
writeln(' Recieve (Ascii)');
beep;
textcolor(7);
writeln;
Writeln(' Enter File Name ');write(' > ');
Readln(File_name);
if length(file_name)>0 then
begin
assign(infile, file_name);
{$I-} Rewrite(infile) {$I+};
ok:=(IOResult=0);
end
else
begin
ok:=true;
go_back:=true;
end;
if not ok then
begin
writeln(' Exists: Rewrite ?');
repeat until keypressed;
read(kbd,a);
if (a=chr(89)) or (a=chr(121)) then ok:=true;
end;
delay(2000);
until ok;
if not go_back then
begin
normvideo;
lowvideo;
Window(1,1,80,21);
gotoxy(1,1);
insline;
textcolor(white+blink);
write(chr(16):21);
textcolor(7);
write(' RECIEVE FILE <Alt-R> to terminate ');
textcolor(white+blink);
writeln(chr(17));
normvideo;
lowvideo;
window(1,2,80,21);
ClrScr;
gotoxy(1,21);
textcolor(maincolor);
repeat
if commpressed then
begin
b:=cinkey;
tempbuff[pointer]:=b;
write(b);
pointer:=pointer+1;
if pointer=256 then
begin
for i:=1 to 255 do
begin
write(infile,tempbuff[i]);
end;
pointer:=1;
end;
end;
if keypressed then
begin
read(kbd,a);
if a<>chr(19) then write_byte(a);
end;
until a=chr(19);
for i:=1 to pointer do
begin
write(infile,tempbuff[i]);
end;
close(infile);
writeln;writeln;writeln('DONE.');
delay(2000);beep;beep;
end;
normvideo;
move(screen2,screen1,4000);
lowvideo;
window(1,1,80,21);
Textcolor(maincolor);
gotoxy(xcoord,ycoord);
end;